SuperStrict

'@build	bmx makeapp (-x [to run after build]) -r -o (-a [if not quick build]) "php.test1.exe" "php.test1.bmx"
'@note	Or just use MaxIDE, MaxIDE Community Edition, MaxIDE X, BLide, or any other IDE you want.

Framework BRL.Retro

Include "./library/php.inc.bmx";

Print "php Test 1~n";

' substr Tests
Print "substr examples";

Print "~nExample 1";
Print "A: " + substr( "abcdef", -1 );
Print "B: " + substr( "abcdef", -2 );
Print "C: " + substr( "abcdef", -3, 1 );

Print "~nExample 2";
Print "A: " + substr( "abcdef", 0, -1 );
Print "B: " + substr( "abcdef", 2, -1 );
Print "C: " + substr( "abcdef", 4, -4 );
Print "D: " + substr( "abcdef", -3, -1 );

' hexdec Tests
Print "~nhexdec examples";

Print "~nExample 1";
Print "A: " + hexdec("See");
Print "B: " + hexdec("ee");

Print "~nC: " + hexdec("that");
Print "D: " + hexdec("a0");

' str_repeat Tests
Print "~nstr_repeat examples";

Print "~nExample 1";
Print "A: " + str_repeat("-=", 10);

Print "~nExample (NRG)";
Print "B: " + str_repeat("-=", 0);
Print "C: " + str_repeat("-=", 1);

' Count Tests
Print "~ncount";

Local a:Int[] = New Int[3];
a[0] = 1;
a[1] = 3;
a[2] = 5;
Print "~nA: " + count_int( a );
Local b:String[] = New String[11];
b[0] = "7";
b[5] = "9";
b[10]= "11";
Print "B: " + count( b );
